package chuangyi.com.org.ViewModel;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import chuangyi.com.org.ViewModel.User;
import chuangyi.com.org.ViewModel.SearchRecord;
import chuangyi.com.org.ViewModel.NetFileCahe;

import chuangyi.com.org.ViewModel.UserDao;
import chuangyi.com.org.ViewModel.SearchRecordDao;
import chuangyi.com.org.ViewModel.NetFileCaheDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig searchRecordDaoConfig;
    private final DaoConfig netFileCaheDaoConfig;

    private final UserDao userDao;
    private final SearchRecordDao searchRecordDao;
    private final NetFileCaheDao netFileCaheDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
        searchRecordDaoConfig.initIdentityScope(type);

        netFileCaheDaoConfig = daoConfigMap.get(NetFileCaheDao.class).clone();
        netFileCaheDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
        netFileCaheDao = new NetFileCaheDao(netFileCaheDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(SearchRecord.class, searchRecordDao);
        registerDao(NetFileCahe.class, netFileCaheDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        searchRecordDaoConfig.clearIdentityScope();
        netFileCaheDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public SearchRecordDao getSearchRecordDao() {
        return searchRecordDao;
    }

    public NetFileCaheDao getNetFileCaheDao() {
        return netFileCaheDao;
    }

}
